package Merlion.CRM.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;


@Entity
public class SalesOrderEntity extends SalesDocumentEntity implements Serializable {
  
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long    id;
    private int     leadTime;
    private int     leadTimeConfirmed;//"Yes" or "No(state new lead time)"
    private String  creditCheckStatus;//"In Progress"/"Approved"/"Not Approved"
    private String  ATPCheckStatus;//"In Progress"/"Avalaible"/"Not Available"
    private String  status;//In Progress/On Hold/Validated/Rejected/Voided/Completed
    @OneToOne
    private PurchaseOrderEntity purchaseOrder;
    private String shippingMethod;//Land//Air//Sea
    private String shippingRule;//Availability 
    private String invoiceRule;//AfterDelivery
    private String paymentMethod;//On Credit/Cash
    private String priority;
    private String freightCostRule;
    private String currency;
    private boolean isApproved; //approved by customer
    private boolean isRejected;
    private boolean isOnHold;
    private boolean isValidated;
    private boolean isVoided;
    private boolean isCompleted;
    private boolean cashInAdvanced;
    private boolean referred;
    private double  totalPrice;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dueDate;
    @OneToMany(mappedBy= "salesOrder")
    private List<DeliveryOrderEntity> deliveryOrderList;

    public SalesOrderEntity(){}
    
    
    public PurchaseOrderEntity getPurchaseOrder() {
        return purchaseOrder;
    }

    public void setPurchaseOrder(PurchaseOrderEntity purchaseOrder) {
        this.purchaseOrder = purchaseOrder;
    }

    public int getLeadTime() {
        return leadTime;
    }

    public void setLeadTime(int leadTime) {
        this.leadTime = leadTime;
    }

    public String getATPCheckStatus() {
        return ATPCheckStatus;
    }

    public void setATPCheckStatus(String ATPCheckStatus) {
        this.ATPCheckStatus = ATPCheckStatus;
    }

    public String getCreditCheckStatus() {
        return creditCheckStatus;
    }

    public void setCreditCheckStatus(String creditCheckStatus) {
        this.creditCheckStatus = creditCheckStatus;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getleadTimeConfirmed() {
        return leadTimeConfirmed;
    }

    public void setleadTimeConfirmed(int leadTimeConfirmed) {
        this.leadTimeConfirmed = leadTimeConfirmed;
    }

    

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getShippingMethod() {
        return shippingMethod;
    }

    public void setShippingMethod(String shippingMethod) {
        this.shippingMethod = shippingMethod;
    }

    public String getFreightCostRule() {
        return freightCostRule;
    }

    public void setFreightCostRule(String freightCostRule) {
        this.freightCostRule = freightCostRule;
    }

    public String getInvoiceRule() {
        return invoiceRule;
    }

    public void setInvoiceRule(String invoiceRule) {
        this.invoiceRule = invoiceRule;
    }

    public int getLeadTimeConfirmed() {
        return leadTimeConfirmed;
    }

    public void setLeadTimeConfirmed(int leadTimeConfirmed) {
        this.leadTimeConfirmed = leadTimeConfirmed;
    }

    public String getPriority() {
        return priority;
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public String getShippingRule() {
        return shippingRule;
    }

    public void setShippingRule(String shippingRule) {
        this.shippingRule = shippingRule;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }
    
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public boolean isIsApproved() {
        return isApproved;
    }

    public void setIsApproved(boolean isApproved) {
        this.isApproved = isApproved;
    }

    public boolean isIsCompleted() {
        return isCompleted;
    }

    public void setIsCompleted(boolean isCompleted) {
        this.isCompleted = isCompleted;
    }

    public boolean isIsOnHold() {
        return isOnHold;
    }

    public void setIsOnHold(boolean isOnHold) {
        this.isOnHold = isOnHold;
    }


    public boolean isIsRejected() {
        return isRejected;
    }

    public void setIsRejected(boolean isRejected) {
        this.isRejected = isRejected;
    }


    public boolean isIsValidated() {
        return isValidated;
    }

    public void setIsValidated(boolean isValidated) {
        this.isValidated = isValidated;
    }

    public boolean isIsVoided() {
        return isVoided;
    }

    public void setIsVoided(boolean isVoided) {
        this.isVoided = isVoided;
    }

    public boolean isCashInAdvanced() {
        return cashInAdvanced;
    }

    public void setCashInAdvanced(boolean cashInAdvanced) {
        this.cashInAdvanced = cashInAdvanced;
    }

    public List<DeliveryOrderEntity> getDeliveryOrderList() {
        return deliveryOrderList;
    }

    public void setDeliveryOrderList(List<DeliveryOrderEntity> deliveryOrderList) {
        this.deliveryOrderList = deliveryOrderList;
    }

    public boolean isReferred() {
        return referred;
    }

    public void setReferred(boolean referred) {
        this.referred = referred;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

}
